<!-- 博客文章教程使用 -->
测试示例本文 {{ .Page.RelPermalink }}
<br>

{{- $toot_map := resources.Get "data/toot_map.json" | transform.Unmarshal -}}

<span>读取固定值 /posts/2024-02-15-wkd/ </span>

{{ $found := false }}
{{ range $item := $toot_map }}
    {{ $key := index $item "key" }}
    {{ $value := index $item "value" }}
    {{ if eq (index $key 1) "/posts/2024-02-15-wkd/" }}
        URI: {{ index $value "uri" }}
        {{ $found = true }}
    {{ end }}
{{ end }}

{{ if not $found }}
    没找到 /posts/2024-02-15-wkd/
{{ end }}

<hr/>

<span>读取固定值页面 slug  </span>
{{ $found := false }}
{{ range $item := $toot_map }}
    {{ $key := index $item "key" }}
    {{ $value := index $item "value" }}
    {{ if eq (index $key 1)  .Page.RelPermalink }}
        URI: {{ index $value "uri" }}
        {{ $found = true }}
    {{ end }}
{{ end }}

{{ if not $found }}
    没找到 {{ .Page.RelPermalink }}
{{ end }}

<hr/>